package org.boot.easyapi.core.framework;

import org.boot.easyapi.properties.EasyApiProperties;
import org.boot.easyapi.util.spring.SpringUtil;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;

/**
 * 加载easyapi
 *
 * @author xzy
 */
@AutoConfiguration
@ComponentScan("org.boot.easyapi")
@EnableConfigurationProperties(EasyApiProperties.class)
public class EasyApiAutoConfiguration {
    public EasyApiAutoConfiguration() {
        System.out.println("\n" +
                "┌─┐┌─┐┌─┐┬ ┬┌─┐┌─┐┬\n" +
                "├┤ ├─┤└─┐└┬┘├─┤├─┘│\n" +
                "└─┘┴ ┴└─┘ ┴ ┴ ┴┴  ┴\n" +
                "version:1.0.0"
        );
        Object easyApiFileStarter = SpringUtil.getBean("easyapi-file-EasyApiFileAutoConfiguration");
        if(easyApiFileStarter != null){
            System.out.println("plugin staring --> easyapi-file-starter");
        }
        Object easyApiLoggerStarter = SpringUtil.getBean("easyapi-logger-EasyApiFileAutoConfiguration");
        if(easyApiLoggerStarter != null){
            System.out.println("plugin staring --> easyapi-logger-starter");
        }
        Object easyApiPermissionStarter = SpringUtil.getBean("easyapi-permission-EasyApiPermissionAutoConfiguration");
        if(easyApiPermissionStarter != null){
            System.out.println("plugin staring --> easyapi-permission-starter");
        }
        System.out.println("\n");
    }
}